import request from '@/utils/request.js'

// 常量
const api_name = '/user/h5/address'

export default {
    getAddressList() {
        return request({
            url: `${api_name}/getAddressList`,
            method: 'get'
        })
    },
    getAddressDetailsById(id) {
        return request({
            url: `${api_name}/getAddressDetailsById/${id}`,
            method: 'get'
        })
    },
    saveAddress(data) {
        return request({
            url: `${api_name}/saveAddress`,
            method: 'post',
            data: data
        })
    },
    updateAddress(data) {
        return request({
            url: `${api_name}/updateAddress`,
            method: 'post',
            data: data
        })
    },
    deleteById(id) {
        return request({
            url: `${api_name}/deleteById/${id}`,
            method: 'post'
        })
    }
}

